<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>

<script>

    var num1 = 100;
    var num2 = 200;
    var num3 = 300;
    var num4 = 7;
    console.log('num1' + '+' + 'num2' + '=' + (num1 + num2));// 加法运算
    console.log('num1' + '-' + 'num2' + '=' + (num1 - num2));// 加法运算
    console.log('num1' + '=' + 'num2' + '=' + (num1 * num2));// 乘法运算
    console.log('num3' + '/' + 'num1' + '=' + (num3 / num1));// 除法运算
    console.log('num3' + '%' + 'num1' + '=' + (num3 % num1));// 取余运算
    console.log('num1' + '%' + 'num4' + '=' + (num1 % num4));// 取余运算
    // 自增自减元算符 ++ --
    // console.log('num1++' + '=' + num1++);// 100
    // console.log((num1++));// 101
    // console.log(num1);
    // console.log('-------------');
    // console.log('++num2' + '=' + ++num2)// 101
    // console.log(num2);   
// console.log( ++num1 + num1++ + '------------' + num1);
// console.log(num1++ + num1++);
// console.log(num1++ + num1++ + ++num1);
// console.log(num1++ + ++num2 + ++num3 + ++num1);
// console.log(++num1 - --num1 + num2++ + ++num3 + num2);
// console.log('num1' + '+=' + 'num2' + '=' + (num1 += num2));
// console.log('num1' + '-=' + 'num2' + '=' + (num1 -= num2));
// console.log('num1' + '%=' + 'num4' + '=' + (num1 %= num4));
var a=10;//一个=号是赋值,两=号是比较
var b=20;
var c=30;
var d=10;
var e=10;
var str = '张三';
console.log(a == b);//false
console.log(a == d)//true
console.log(a == c)//false
console.log(a == e)//true
console.log(a == e)//隐式转换 只比较数值 不比较类型
console.log(a === e)//即比较数值也比较类型
console.log(a != e)//只比较值，不比较类型
console.log(a !== e)//即比较数值也比较类型
//一些特殊情况的运算
console.log(a + str);//10张三
console.log(a + e);//1010
console.log(a - str);//NaN (数据类型任然属于Number)
console.log(a - e);

</script>